/*
 * Test program for 8x8 LED matrix (single color) and shift registor
 *
 * HISTORY
 * 2010/8/4  NEW
 *
 */

/*
 * Copyright (c) 2010 elekid
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
 */

// for 7 segments x 4 display
int CLOCK_PIN =2;
int DATA_PIN  =3;

byte PATTERN[8] = {
B10110000,
B10101010,
B11101100,
B10101010,
B11111010,
B10101010,
B11111110,
B10101010,
};

void setup()
{

  pinMode(CLOCK_PIN, OUTPUT);
  pinMode(DATA_PIN,  OUTPUT);

  delay(1000);
}
void loop()
{
  for ( int i = 0 ; i < 8 ; i+=2) {
    shiftOut(DATA_PIN, CLOCK_PIN, LSBFIRST, PATTERN[i]);
    shiftOut(DATA_PIN, CLOCK_PIN, LSBFIRST, PATTERN[i+1]);
    delay(800);
  }
}


